package iterator;

/**
 * @author wcj
 * @Date 2021/7/4 20:17
 * @Version 1.0
 */
public class Client {

    public static void main(String[] args) {
        ConcreteAggregate concreteAggregate = new ConcreteAggregate();
        concreteAggregate.setObj(new Object());
        concreteAggregate.setObj(new Object());
        concreteAggregate.setObj(new Object());
        concreteAggregate.setObj(new Object());
        Iterator iterator = concreteAggregate.createIterator();
        while (iterator.hasNext()) {
            Object next = iterator.next();
            System.out.println(next);
        }
    }
}
